import request from "@/utils/request";

// 登录方法
export function login(id, password) {
    const data = {
        id,
        password,
    }
    return request({
        url: '/user/login',
        headers: {
            isToken: false
        },
        method: 'post',
        data: data
    })
}

export function pageStudents(pageNum, pageSize) {
    return request({
        url: '/user/students?pageNum=' + pageNum + "&pageSize=" + pageSize,
        method: 'get'
    })
}

export function delStudent(id) {
    return request({
        url: '/user/' + id,
        method: 'DELETE'
    })
}

export function getStudentById(id) {
    return request({
        url: '/user/' + id,
        method: 'GET'
    })
}

export function addStudent(stu) {
    return request({
        url: '/user/',
        method: 'POST',
        data: stu
    })
}

export function updateStudent(stu) {
    return request({
        url: '/user/',
        method: 'PUT',
        data: stu
    })
}


